<template>
  <div class="tabbar">
    <router-link
    v-for="nav in navs"
    :key="nav.path"
    :to="nav.path"
    tag="div">
      <i class="iconfont" v-html="nav.meta.icon"></i>
      <span>{{nav.meta.title}}</span>
    </router-link>
    <!-- <router-link to="/category" tag="div">
      <i class="iconfont">&#xe618;</i>
      <span>分类</span>
    </router-link>
    <router-link to="/cart" tag="div">
      <i class="iconfont">&#xe63d;</i>
      <span>购物车</span>
    </router-link>
    <router-link to="/mine" tag="div">
      <i class="iconfont">&#xe61c;</i>
      <span>我的</span>
    </router-link> -->
  </div>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'Tabbar',
  computed: {
    navs() {
      return routes.filter(route => route.meta.isNav
      )
    }
  }
}
</script>

<style lang="scss" scoped>
  .tabbar {
    display: flex;
    height: 40px;
    div {
      flex: 1;
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .router-link-exact-active.router-link-active {
      background: #eee;
    }
  }
</style>
